<script setup lang="ts">
import localeStore from '@/store/locale'
import { storeToRefs } from 'pinia'
const { localeInfo} = storeToRefs(localeStore())
const router = useRouter()
function onRouteClick(item) {
  if(item.route) {
    router.push(item.route)
  }
}
</script>

<template>
  <div class="surgerydevices">
    <div class="img_txt">
      <img class="maxwidth_img" src="@/assets/img/animal/3.jpg" alt="">
        <p>
          <span>{{localeInfo.surgerydevices.txt}}</span>
          <span>{{localeInfo.surgerydevices.txt1}}</span>
        </p>
    </div>
   <!--  <div class="cards">
      <p v-for="(item,index) in localeInfo.surgerydevices.cardimgs" :key="index" @click="onRouteClick(item)">
        <img v-if="index==0" src="@/assets/img/medical/Electrosurgical.png" alt="">
        <img v-if="index==1" src="@/assets/img/medical/Monitors.png" alt="">
        <img v-if="index==2" src="@/assets/img/medical/Operationlight.png" alt="">
        <img v-if="index==3" src="@/assets/img/medical/Surgerydevices.png" alt="">
        <img v-if="index==4" src="@/assets/img/medical/Scalpels.png" alt="">
        <span>{{item.name}}</span>
      </p>
      <span class="clear"></span>
    </div>
 -->
     <div class="cards">
      <div  v-for="(item,index) in localeInfo.surgerydevices.cardimgs1" :key="index" @click="onRouteClick(item)">
        <p>
             <span>{{item.name}}</span>
        <img v-if="index==0" src="@/assets/img/medical/Electrosurgical.png" alt="">
        <img v-if="index==1" src="@/assets/img/medical/Monitors.png" alt="">
        <img v-if="index==2" src="@/assets/img/medical/Operationlight.png" alt="">
       
        </p>
      </div>
    </div>

    <div class="cards">
      <div  v-for="(item,index) in localeInfo.surgerydevices.cardimgs2" :key="index" @click="onRouteClick(item)">
        <p>
             <span>{{item.name}}</span>
       <!--  <img v-if="index==0" src="@/assets/img/medical/Electrosurgical.png" alt="">
        <img v-if="index==1" src="@/assets/img/medical/Monitors.png" alt="">
        <img v-if="index==2" src="@/assets/img/medical/Operationlight.png" alt=""> -->
        <img v-if="index==0" src="@/assets/img/medical/Surgerydevices.png" alt="">
        <img v-if="index==1" src="@/assets/img/medical/Scalpels.png" alt="">
        <!-- <img v-if="index==1" src="@/assets/img/medical/Scalpels.png" alt=""> -->
        </p>
      </div>
    </div>


      
  </div>
</template>

<style lang="scss" scoped>
.surgerydevices{
  
  .img_txt{
    position: relative;
    img{
      width: 90%;
      display: block;
      margin: 0 auto;
    }
    // p{
    //   position: absolute;
    //   top: 0;
    //   right: 0;
    //   padding:2px 4px;
    //   background-color: rgba(203,204,203,0.5);
    //   span{
    //     display: block;
    //      font-weight: bolder;
    //      font-weight: 10PX;
    //      color: #FFF;
    //     &:nth-child(1) {
    //       margin-bottom: 25PX;
    //       font-size: 30PX;
    //       line-height: 30PX;
    //     }
    //   }
    // }
    p{
      width: 50%;
      position: absolute;
      top: 0;
      right: 0;
      padding:2px 4px;
      background-color: rgba(203,204,203,0.5);
      // text-align: center;
      span{
         display: block;
         font-weight: bolder;
         font-weight: 10PX;
         color: #FFF;
         font-size: 15px;
         line-height: 30px;
        &:nth-child(1) {
          margin-bottom: 25PX;
          font-size: 20px;
          line-height: 40px;
        }
      }
    }
  }
  // .cards{
  //   padding: 20px 15px;
  //   p{
  //     position: relative;
  //     border: 1.5PX solid rgba(166,166,166,1);
  //     border-radius: 20PX;
  //     width: 15%;
  //     height: 80px;
  //     margin-right: 5%;
  //     margin-bottom: 15px;
  //     float: left;
  //     display: flex;
  //     display: -webkit-flex;
  //     flex-direction: column;
  //     justify-content: center;
  //     align-items: center;
  //     padding: 10px 20px;
  //     cursor: pointer;
  //     &:nth-child(3n){
  //       margin-right: 0;
  //       margin-left: 5%;
  //     }
  //     span{
  //       position: absolute;
  //       // top: 0;
  //       left: 0;
  //       z-index: 5;
  //       font-size: 30PX;
  //       color: #FFF;
  //       display: block;
  //       width: 100%;
  //       height: 20px;
  //       line-height: 20px;
  //       text-align: center;
  //       background-color: rgba(223,223,223,0.5);
  //     }
  //     img{
  //       width: 100%;
  //       height: 100%;
  //     }
  //   }
  // }
  .cards{
      padding: 0 10%;

      display: flex;
        display: -webkit-flex;
        justify-content: center;
        align-items: center;
        &:nth-child(1) {
          div{
              // margin-top: 20px;
          }
        }
      div{
        
        width: 80px;
        height: 80px;
        margin-bottom: 10px;
        border: 1.5PX solid rgba(66,66,66,0.5);
        margin-right: 8px;
        border-radius: 5px;
        overflow: hidden;
              
        &:hover{
            width: 100px;
            height: 100px;
            margin-bottom: 10px;
            p{
            height: 80px;
            display: flex;
            display: -webkit-flex;
            justify-content: center;
            align-items: center;
            position: relative;
            // background-color: rgba(66,66,66,0.5);
            img{
              display: block;
              width: 60px;
              height: 60px;
             
            }
            span{
              display: inline-block;
              position: absolute;
              top: 0px;
              // height: 100%;
              line-height: 100px;
               color: #fff;
            background: rgba(0,0,0,0.15);
            // line-height: 80px;
            position: absolute;
            line-height: 20px;
            top: 40px;
            // height: 100%;
            font-size: 8px;
            text-align: center;
              
            }
            }
          }
        p{
          height: 100%;
          position: relative;
          display: flex;
          display: -webkit-flex;
          justify-content: center;
          align-items: center;
          cursor: pointer;
          
          img{
            width: 40px;
            height: 40px;
            max-width: 50px;
            display: block;
          }
          span{
            display: inline-block;
            width: 100%;
            color: #fff;
            background: rgba(0,0,0,0.15);
            // line-height: 80px;
            position: absolute;
            line-height: 20px;
            top: 30px;
            // height: 100%;
            font-size: 8px;
            text-align: center;
            

          }
         }
      }
   
    }
}
</style>
